package com.zlm.Thread;

import java.util.concurrent.Callable;

/**
 * @author 13026
 */
public class MyThread3 implements Callable<Integer> {

    @Override
    public Integer call() throws Exception {
        // 求1-100的和
        int sum = 0;
        // 获取当前线程对象
        Thread t = Thread.currentThread();
        for (int i = 0; i < 100; i++) {
            sum += i;
            System.out.println(t.getName() + "hello word");
        }
        return sum;
    }
}
